package databasetranslation;

import java.sql.SQLException;

import database.SQLServer;

public class DatabaseLists {
	
	private ClientList clients;
	private WorkshopList workshops;
	private PaymentList payments;
	private SubscriptionList subscriptions;
	
	public DatabaseLists(SQLServer server) {
		clients = new ClientList(server);
		workshops = new WorkshopList(server);
		subscriptions = new SubscriptionList(server, workshops, clients);
		payments = new PaymentList(server, clients);
	}
	
	public boolean isEqualToDatabase() throws SQLException {
		return (	clients.isEqualToDatabase() &&
					workshops.isEqualToDatabase() &&
					payments.isEqualToDatabase() &&
					subscriptions.isEqualToDatabase()
		);
	}
	
	public void importDataFromDatabase() throws SQLException {
		clients.importList();
		workshops.importList();
		payments.importList();
		subscriptions.importList();
	}
	
	public ClientList getClientList() {
		return clients;
	}
	
	public WorkshopList getWorkshopList() {
		return workshops;
	}
	
	public PaymentList getPaymentList() {
		return payments;
	}
	
	public SubscriptionList getSubscriptionList() {
		return subscriptions;
	}

}
